<script setup>
import { ref } from 'vue'
import Card from './components/Card.vue'

const entryList = ref([
  {
    enTitle: 'Avenue mechanism',
    zhTitle: '大道机制',
    url: 'https://img.js.design/assets/img/669fc7d0ffaa0738e4ae2a9b.png#e892a0992cfea3cd103bc639c58ef90d',
    path: '',
  },
  {
    enTitle: 'Venue application',
    zhTitle: '场地申请',
    url: 'https://img.js.design/assets/img/669fc5d6d664ced7d91826b4.png#d53d30a91b11363d143edbff4319f690',
    path: '/pages/cooperate/venue',
  },
  {
    enTitle: 'Advertising application',
    zhTitle: '广告位申请',
    url: 'https://img.js.design/assets/img/669fc91b36d3aa0980f795ba.png#773697cc72ef37470021ad9b76374047',
    path: '',
  },
  {
    enTitle: 'Collaboration Contact',
    zhTitle: '合作关系',
    url: 'https://img.js.design/assets/img/669fc56af628c5f9757b89e3.png#2d4a10f34ab676df3f2376b6500f5e48',
    path: '/pages/cooperate/contact',
  },
])

const toPage = (item) => {
  console.log(item, '33===')
  if (!item.path) {
    return uni.showToast({
      title: '敬请期待～',
      icon: 'none',
    })
  }
  uni.navigateTo({ url: item.path })
}
</script>

<template>
  <view class="cooperate">
    <Card
      v-for="(item, index) in entryList"
      :key="index"
      :enTitle="item.enTitle"
      :zhTitle="item.zhTitle"
      :url="item.url"
      @tap="toPage(item)"
    />
  </view>
</template>

<style lang="scss" scoped>
.cooperate {
  background: #ffffff;
  padding: 20rpx 48rpx;
  ::v-deep {
    .card {
      margin-bottom: 24rpx;
    }
  }
}
</style>
